home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0799 / 563 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  3.6 KB

  1. Subject: Re: pipes & ptys
  2. Date: Wed, 20 Oct 93 1:57:26 CET
  3. From: Juergen Lock <nox@jelal.north.de>
  4. In-Reply-To: <9310182237.AA10225@hanauma.jpl.nasa.gov>; from "Howard Chu" at Oct 18, 93 3:36 pm
  5. Message-Id: <9310200057.AA00515@jelal.north.de>
  6.  
  7. Howard Chu writes:
  8. >    now how fix this (i mean _really_ fix this. so that a 1k read ends up
  9. >   as one 1k device read whenever possible, without additional moving data
  10. >   around) and stay compatible with existing devices?  here is an idea...
  11. >   
  12. >   1. add 2 optional functions to DEVDRV struct, for now i call them bread
  13. >   and bwrite. (NULL means they are not there)  they work like device read
  14. >   and write, only with bytes instead of longs.  (btw there are 3 longs
  15. >   reserved in DEVDRV now and i can think of atleast 2 more functions to
  16. >   add later, readv and writev...  so extend the struct somehow?)
  17. >   
  18. >   2. if bwrite is there use it instead of write in tty_write (also in
  19. >   bflush, midiws...), if the write is RAW just check for job control and
  20. >   return (*f->dev->bwrite)(f, buf, nbytes);
  21. >    and if bread is there do the same atleast for RAW reads in tty_read.
  22. >   (this includes reading pty masters...)
  23. >   
  24. >   3. add bread and bwrite functions to the pty device.  the slaves output
  25. >   pipe can then be changed to use bytes directly. (i think.  the other
  26. >   direction of course not...)
  27. >   
  28. >   4. add support for CLOCAL, HUPCL, VMIN etc and make _real_ modem devices...
  29. >   with bread/bwrite they finally could get decent thruput without 99% CPU load.
  30. > ...and CTLECHO, I guess we want full termio(s) support, eh?
  31.  
  32.  ok :)
  33. >   
  34. >    this is just an idea i got and i have no idea if and when i could do
  35. >   all this... :)  but what do you think?
  36. > I kind of like it. The main point being, we want a system call that actually
  37. > reads or writes more than 1 byte at a time for ttys. So doing an Fread of 1K
  38. > on /dev/modem1 does a single call, not 1000 Bconin's...
  39.  
  40.  yes that would be bread.  the new modem devices bread would get a RAW
  41. 1k read as that, maybe go to sleep until there is >= VMIN bytes data and
  42. then just do 1 or 2 bcopy()s out of the ports receiver buffer right into
  43. the reading processes memory.  no extra moving data around, no multiple
  44. device read calls, can't get any faster...
  45.  
  46. >  I would like to see
  47. > these new read and write functions replace Bconin/Bconout, with Bcon* just
  48. > being a special-case (single-character) of them.
  49. > I would suggest that a better way to handle this would be to continue
  50. > supporting the 4 bytes per character, but have an additional flag bit which
  51. > indicates whether or not the caller is interested in the 3 extra bytes. If not,
  52. > just perform the data copy by incrementing the pointer by 4 instead of by 1...
  53.  
  54.  hmm i think i did not make that clear, the devices `old' 4-byte
  55. read/write functions would still be there and working, and a Bconin
  56. would still end up as one and can get 32 bit.  only MiNT >= version x
  57. would use bread/write for Fread/write on devices where they are != 0.
  58.  
  59.  doing this with a flag would introduce compatibility problems with
  60. old devices i think... (ok, depends on how you do it.)  and incrementing
  61. the pointer by 4 instead of 1 would still need expanding/collapsing data
  62. into an extra buffer at least once for each Fread/write (and split up
  63. the read/write into chunks not bigger than this buffer, etc...) and it
  64. would still take longer than a device with just bcopy.
  65.  
  66.  more comments?  (Eric?)
  67.  
  68.  cheers
  69.     Juergen
  70. -- 
  71. J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
  72.                                 ...ohne Gewehr
  73. PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA 
  74.